package org.jiulou.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DatetimeUtil {
	public static final String DATE_TIME_PATTERN = new String("yyyy-MM-dd HH:mm:ss");
	public static final String DATE_PATTERN = new String("yyyy-MM-dd");
	
	/**
	 * only for format the java.util.Date
	 */
	public static final SimpleDateFormat DATE_TIME_FORMAT = new SimpleDateFormat(DATE_TIME_PATTERN);
	/**
	 * only for format the java.util.Date
	 */	
	public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat(DATE_PATTERN);
	
	/**
	 * 返回当前时间的字符格式：yyyy-MM-dd HH:mm:ss
	 * @return
	 */
	public static String nowStr(){
		return DATE_TIME_FORMAT.format(new Date());
	}
}
